001    package net.sf.xdc.processing;
002    
003    /*
004     *  Copyright 2005-2006 Jens Voß.
005     *
006     *  Licensed under the GNU Lesser General Public License (the "License");
007     *  you may not use this file except in compliance with the License.
008     *  You may obtain a copy of the License at
009     *
010     *       http://opensource.org/licenses/lgpl-license.php
011     *
012     *  Unless required by applicable law or agreed to in writing, software
013     *  distributed under the License is distributed on an "AS IS" BASIS,
014     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015     *  See the License for the specific language governing permissions and
016     *  limitations under the License.
017     */
018    
019    import org.apache.commons.cli.Option;
020    
021    /**
022     * This class represents a command line option of the XDC application.
023     *
024     * @author Jens Voß
025     * @since 0.5
026     * @version 0.5
027     */
028    public class XdcOption extends Option {
029    
030      private boolean xslParam;
031      private String opt2;
032    
033      /**
034       * Public constructor.
035       *
036       * @param opt The command line option string
037       * @param description A description of this <code>XdcOption</code>
038       * @param xslParam Specifies whether this option is to be passed to the
039       *         processing XSLT stylesheet via a stylesheet parameter
040       * @throws IllegalArgumentException
041       */
042      public XdcOption(String opt, String description, boolean xslParam)
043              throws IllegalArgumentException {
044        super("xdc", false, description);
045        opt2 = opt;
046        this.xslParam = xslParam;
047      }
048    
049      /**
050       * Public constructor. Allows the specification of an additional argument.
051       *
052       * @param opt The command line option string
053       * @param argName The name of an additional argument
054       * @param description A description of this <code>XdcOption</code>
055       * @param xslParam Specifies whether this option is to be passed to the
056       *         processing XSLT stylesheet via a stylesheet parameter
057       * @throws IllegalArgumentException
058       */
059      public XdcOption(String opt, String argName, String description, boolean xslParam)
060              throws IllegalArgumentException {
061        super("xdc", true, description);
062        opt2 = opt;
063        this.setArgName(argName);
064        this.xslParam = xslParam;
065      }
066    
067      /**
068       * Getter method for this <code>XdcOption</code>'s <code>xslParam</code>
069       * field which determines whether or not this command line option is passed
070       * to the processing XSLT stylesheet via a stylesheet parameter.
071       *
072       * @return <b>true</b> if this command line option is to be passed to the
073       *          respective XSLT stylesheet for processing; <b>false</b> otherwise
074       */
075      public boolean isXslParam() {
076        return xslParam;
077      }
078    
079    
080      public String getOpt() {
081        return opt2;
082      }
083    }